<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>学生信息录入统计-云校通-教师</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
<body ontouchstart style="background:#fff;">
	<div class="weui_tab tab-bottom">
		<div class="weui-header bg-blue"> 
	  		<div class="weui-header-left"> <a onclick="back()" href="javascript:" class="icon icon-109 f-white">返回</a> </div>
	    	<h1 class="weui-header-title">学生信息录入统计</h1>
	    </div>
		<div class="weui_tab_bd">
			<div class="weui_cells mt0">
		    	<div class="weui_cell">
			    	<div class="weui_cell_hd weui_center_50"><b>班级</b></div>
			    	<div class="weui_cell_hd weui_center_25"><b>已录入</b></div>
			    	<div class="weui_cell_hd weui_center_25"><b>未录入</b></div>
			    </div>
		    </div>
		    <div id="gradeList" class="mb40">
		    </div>
		</div>
	</div>
	
</body>
<jsp:include page="/WEB-INF/page/common/_footer.jsp"></jsp:include>
<script type="text/javascript">
	$(function() {
		initGrade();
	})
	function initGrade() {
		$.ajax({
   	 		url : basePath + "/ls/students/manage/inputTotal/query",
   	 		type : "post",
   	 		dataType : "json",
   	 		async : false,
   	 		success : function(data) {
   	 			if(data != null && data.length > 0) {
   	 				var html = "";
   	 				for(var i in data) {
   	 					var itm = data[i];
   	 					html += '<div><div class="js-category" data-grade="'+itm.grade+'" data-clazz="'+itm.clazz+'">\
						            	<div class="weui_cells mt0">\
							            	<div class="weui_cell">\
						   	 				    <div class="weui_cell_hd weui_center_50">'+itm.gradeName+"（"+itm.clazz+'）班</div>\
						   					    <div class="weui_cell_hd weui_center_25">'+itm.hadSign+'</div>\
						   					    <div class="weui_cell_hd weui_center_25"><a href="javascript:;">'+itm.noSign+'</a></div>\
						   				    </div>\
						   				</div>\
						            </div>\
				                    <div class="page-category js-categoryInner">\
						            </div></div>';
   	 				}
   	 				$("#gradeList").html(html);
	   	 			$('.js-category').click(function(){
		   	 			$parent = $(this);
		   	             if($parent.hasClass('js-show')){
		   	                 $parent.removeClass('js-show');
		   	              	 $parent.next().addClass("hide");
		   	             }else{
		   	                 $parent.siblings().removeClass('js-show');
		   	                 $parent.addClass('js-show');
		   	                 $(".js-categoryInner").addClass("hide")
		   	              	 $parent.next().removeClass("hide");
		   	                 getStuList($(this));
		   	             }
		   	 	     });
   	 			}
	   	 	}, error:function(){
		 		$.toptips("查询异常");
	 		}
	 	});
	}
	function getStuList(thiz) {
    	if(thiz.next().html().trim() != '') {
    		thiz.next().removeClass("hide");
    		return;
    	}
    	$.ajax({
   	 		url : basePath + "/ls/students/manage/noInput/list",
   	 		type : "post",
   	 		dataType : "json",
   	 		data: {
   	 			grade: thiz.attr("data-grade"),
   	 			clazz: thiz.attr("data-clazz")
   	 		},
   	 		async : false,
   	 		success : function(data) {
   	 			if(data != null && data.length > 0) {
   	 				var html = '<div class="weui_cells weui_cells_access bg_gry mt0">\
   	 								<div class="weui_cell lblue afterNone afterNoneBefore bg_gry b_left">\
   	 									<div class="weui_cell_bd weui_cell_primary"><p>学生列表</p></div>\
   	 								</div>\
   	 							</div>';
   	 				
   	 				for(var i in data) {
   	 					var itm = data[i];
   	 					html+= '<div class="weui_cell bg-white clear">\
			   	 					<div class="weui_cell_bd weui_cell_primary f-15">\
				   	 					<p class="xcgl_student_wrap"><span style="width: 50%;">'+itm.gradeName+'（'+itm.clazz+'）班</span><span>'+itm.name+'</span></p>\
				   	 				</div>\
				   	 			</div>';
   	 				}
   	 				html += '</div>';
   	 				thiz.next().html(html);
   	 			}
   	 		}, error:function(){
  	 			$.toptips("查询异常");
     		}
	 	});
	}
	
</script>
</html>